package com.zmn.oms.business.interfaces.serviceitem;

import com.zmn.oms.common.dto.ResultDTO;
import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.dto.serviceitem.AddOrderServiceItemDTO;
import com.zmn.oms.model.entity.product.OrderProduct;
import com.zmn.oms.model.entity.product.OrderProductExtend;
import com.zmn.oms.model.entity.serviceitem.OrderServiceItem;
import com.zmn.oms.model.entity.work.OrderWork;

import java.util.List;

/**
 * 类描述：订单产品服务项实现
 *
 * @author heciqi
 * @date 2018/12/05 17:17
 */
public interface OrderServiceItemBService {

    /**
     * 新增订单服务项
     *
     * @param addOrderServiceItemDTO
     */
    Integer getDiscount(AddOrderServiceItemDTO addOrderServiceItemDTO) throws OmsBaseException;

    /**
     * 新增订单服务项
     *
     * @param addOrderServiceItemDTO
     */
    ResultDTO insertServiceItem(AddOrderServiceItemDTO addOrderServiceItemDTO) throws OmsBaseException;

    /**
     * 删除订单服务项
     *
     * @param orderId
     */
    void deleteServiceItemByOrderId(Long orderId);

    /**
     * 工程师领单时产生服务项
     *
     * @param orderWork
     */
    void createServiceItemByMasterTake(OrderWork orderWork) throws OmsBaseException;

    /**
     * 修改订单时重置服务项
     *
     * @param orderWork
     */
    void resetServiceItemByUpdate(OrderWork orderWork) throws OmsBaseException;

    /**
     * 获取订单金额
     *
     * @param orderWork
     * @param orderProduct
     * @return
     */
    Integer getServiceItemOriginalAmount(OrderWork orderWork, OrderProduct orderProduct);

    /**
     * 删除和创建新的费用服务项
     * @return
     */
    void deleteAndCreateFreeServiceItem(OrderWork orderWork, List<OrderProductExtend> orderProductExtendList, Integer amount);

    /**
     * 处理内部结算价价格
     *
     * @param platWork        平台
     * @param channelId       渠道
     * @param bizType         业务类型
     * @param settlementPrice 原结算价格
     * @param price  销售价格
     *
     * @return
     */
    Integer handleSettlementPrice(Integer platWork, Integer channelId, Integer bizType, Integer settlementPrice, Integer price);

    /**
     * 阶梯价服务项目处理
     * @param serviceItems
     */
    void handleItemsTieredPrice(List<OrderServiceItem> serviceItems);
}
